package ATM.gui;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import ATM.data.AtmData;
import ATM.logic.AdminActionListener;
import ATM.logic.AtmActionListener;

import java.awt.CardLayout;

public class Screen extends JFrame {

	public static final String WELCOME = "Welcome";
	public static final String MENUCUST = "MenuCust";
	public static final String MENUADMIN = "MenuAdmin";
	public static final String TEMPSCREEN = "TempScreen";

	public static final String VIEWBALANCE = "ViewBalance";
	public static final String WITHDRAWCASH = "Withdraw";
	public static final String DEPOSIT = "Deposit";

	public static final String VIEWCUSTOMER = "ViewCustomer";
	public static final String EDITCUSTOMER = "EditCustomer";
	public static final String EDITACCOUNT = "EditAccount";
	public static final String ADDACCOUNT = "AddAccount";
	public static final String CALCULATEINTEREST = "CalculateInterest";
	public static final String NEWCUSTOMER = "NewCustomer";
	public static final String DELETEACCOUNT = "DeleteAccount";

	private JPanel contentPane;

	private Welcome welcome;
	private MenuCust menuCust;
	private MenuAdmin menuAdmin;
	private Variables variables;
	private TempScreen tempScreen;

	private ViewBalance viewBalance;
	private WithDraw withdraw;
	private Deposit deposit;

	private ViewCustomer viewCustomer;
	private AddAccount addAccount;
	private CalculateInterest calculateInterest;
	private NewCustomer newCustomer;
	private DeleteAccount deleteAccount;

	private AtmActionListener aL;
	private AdminActionListener adminaL;
	private CardLayout c;

	public Screen() {
		super("Smart ATM");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 640, 480);
		setResizable(false);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(0, 0, 0, 0));
		setContentPane(contentPane);
		contentPane.setLayout(new CardLayout(0, 0));

		variables = new Variables();
		aL = new AtmActionListener(this);
		adminaL = new AdminActionListener(this);

		welcome = new Welcome(this);
		contentPane.add(welcome, "WELCOME");

		menuCust = new MenuCust(this);
		contentPane.add(menuCust, "MENUCUST");

		menuAdmin = new MenuAdmin(this);
		contentPane.add(menuAdmin, "MENUADMIN");

		tempScreen = new TempScreen(this);
		contentPane.add(tempScreen, "TEMPSCREEN");

		calculateInterest = new CalculateInterest(this);
		contentPane.add(calculateInterest, "CALCULATEINTEREST");

		newCustomer = new NewCustomer(this);
		contentPane.add(newCustomer, "NEWCUSTOMER");

		addAccount = new AddAccount(this);
		contentPane.add(addAccount, "ADDACCOUNT");

		viewCustomer = new ViewCustomer(this);
		contentPane.add(viewCustomer, "VIEWCUSTOMER");

		viewBalance = new ViewBalance(this);
		contentPane.add(viewBalance, "VIEWBALANCE");

		withdraw = new WithDraw(this);
		contentPane.add(withdraw, "WITHDRAWCASH");

		deposit = new Deposit(this);
		contentPane.add(deposit, "DEPOSIT");

		deleteAccount = new DeleteAccount(this);
		contentPane.add(deleteAccount, "DELETEACCOUNT");

		c = (CardLayout) getContentPane().getLayout();

	}

	public AtmActionListener getaL() {
		return aL;
	}

	public void setaL(AtmActionListener aL) {
		this.aL = aL;
	}

	public AdminActionListener getAdminaL() {
		return adminaL;
	}

	public void setAdminaL(AdminActionListener adminaL) {
		this.adminaL = adminaL;
	}

	public MenuCust getMenuCust() {
		return menuCust;
	}

	public Variables getVariables() {
		return variables;
	}

	public void setVariables(Variables variables) {
		this.variables = variables;
	}

	public TempScreen getTempScreen() {
		return tempScreen;
	}

	public void setTempScreen(TempScreen tempScreen) {
		this.tempScreen = tempScreen;
	}

	public void setMenuCust(MenuCust menuCust) {
		this.menuCust = menuCust;
	}

	public MenuAdmin getMenuAdmin() {
		return menuAdmin;
	}

	public void setMenuAdmin(MenuAdmin menuAdmin) {
		this.menuAdmin = menuAdmin;
	}

	public AddAccount getAddAccount() {
		return addAccount;
	}

	public void setAddAccount(AddAccount addAccount) {
		this.addAccount = addAccount;
	}

	public ViewCustomer getViewCustomer() {
		return viewCustomer;
	}

	public void setViewCustomer(ViewCustomer viewCustomer) {
		this.viewCustomer = viewCustomer;
	}

	public ViewBalance getViewBalance() {
		return viewBalance;
	}

	public void setViewBalance(ViewBalance viewBalance) {
		this.viewBalance = viewBalance;
	}

	public void setWelcome(Welcome welcome) {
		this.welcome = welcome;
	}

	public Welcome getWelcome() {
		return welcome;
	}

	public void setDeposit(Deposit deposit) {
		this.deposit = deposit;
	}

	public Deposit getDeposit() {
		return deposit;
	}

	public void setWithDraw(WithDraw withdraw) {
		this.withdraw = withdraw;
	}

	public WithDraw getWithdraw() {
		return withdraw;
	}

	public void setCalculateInterest(CalculateInterest calculateInterest) {
		this.calculateInterest = calculateInterest;
	}

	public CalculateInterest getCalculateInterest() {
		return calculateInterest;
	}

	public void setNewCustomer(NewCustomer newCustomer) {
		this.newCustomer = newCustomer;
	}

	public NewCustomer getNewCustomer() {
		return newCustomer;
	}

	public DeleteAccount getDeleteAccount() {
		return deleteAccount;
	}

	public void setDeleteAccount(DeleteAccount deleteAccount) {
		this.deleteAccount = deleteAccount;
	}

	// skifter mellem cards
	public void show(String card) {
		c.show(this.getContentPane(), card);
	}

}
